/*
LANG: C
ID: zqy11001
PROG: packrec
QQ: 328400264
*/
#include <stdio.h>
#include<cstdlib>
#include<cmath> 
#include<algorithm>
#include<iostream>
using namespace std;
 
#define swap(a, b) do{\
         a ^= b;\
         b ^= a;\
         a ^= b;\
}while(0);
#define max(a, b) ((a)>(b)?(a):(b))
 
int m;
int ans[300], s1[4], s2[4];
int a[4], b[4];
 
void update(int x, int y)
{
         if(x * y < m){
                   
                   m = x * y;
                   memset(ans, 0, sizeof(ans));
         }
         if(x * y == m){
                   cout<<x<<" "<<y<<endl;
                   ans[x] = ans[y] = 1;
         }
}
 
int box(int x1, int y1, int x2, int y2, int x3, int y3,
                   int x4, int y4)
{
         int x, y;
         x = x1 + x2 + x3 + x4;
         y = max(max(y1, y2), max(y3, y4));
         update(x, y);
 
         x = max(x1, x2 + x3 + x4);
         y = y1 + max(y2, max(y3, y4));
         update(x, y);
 
         x = x1 + max(x2, x3 + x4);
         y = max(y1, y2 + max(y3, y4));
         update(x, y);
 
         x = x1 + x4 + max(x2, x3);
         y = max(y1, max(y4, y2 + y3));
         update(x, y);
 
         x = max(max(x1 + x2, x3 + x4), x1 + x4);
         y = max(max(y1 + y3, y2 + y4), y2 + y3);
         update(x, y);
}
 
void srch2(int n)
{
         int i;
         if(n == 4){
                   box(a[s2[0]], b[s2[0]], a[s2[1]], b[s2[1]],
                                   a[s2[2]], b[s2[2]], a[s2[3]], b[s2[3]]);
         }else{
                   for(i = 0; i < 4; i++){
                            if(!s1[i]){
                                     s2[n] = i;
                                     s1[i] = 1;
                                     srch2(n + 1);
                                     s1[i] = 0;
                            }
                   }
         }
}
 
void srch1(int n)
{
         if(n == 4){
                   memset(s1, 0, sizeof(s1));
                   srch2(0);
         }else{
                   srch1(n + 1);
                   swap(a[n], b[n]);
                   srch1(n + 1);
                   swap(a[n], b[n]);
         }
}
 
int main()
{
         int i, j;
        
         for(i = 0; i < 4; i++){
                   scanf("%d%d", &a[i], &b[i]);
         }
         m = 10000;
         srch1(0);
         j =(int ) sqrt(m);
         printf("%d\n", m);
         for(i = 1; i <= j; i++){
                   if(ans[i]){
                            printf("%d %d\n", i, m / i);
                   }
         }
         system("pause");
         return 0;
}
